# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Antoni Aloy <aaloytorrens@gmail.com>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=lomiri-app-launch
pkgver=0.1.9
pkgrel=3
pkgdesc="User space daemon for launching applications"
arch="all"
url="https://gitlab.com/ubports/development/core/lomiri-app-launch"
license="GPL-3.0-only"
depends_dev="
	click-dev
	curl-dev
	dbus-test-runner-dev
	gobject-introspection-dev
	gtest-dev
	json-glib-dev
	lomiri-api-dev
	lttng-ust-dev
	mir-dev
	properties-cpp-dev
	zeitgeist-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	dbus-test-runner
	glib-dev
	lttng-ust-tools
	qt5-qtdeclarative
	samurai
	"
checkdepends="
	bash
	gmock
	gtest-dev
	py3-dbusmock
	"
source="https://gitlab.com/ubports/development/core/lomiri-app-launch/-/archive/$pkgver/lomiri-app-launch-$pkgver.tar.gz
	0001-liblomiri-app-launch-jobs-posix.cpp-pass-more-enviro.patch
	"
subpackages="$pkgname-dev"
options="!check" # test 12/13 appears to hang

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DUSE_SYSTEMD=OFF \
		-DLOMIRI_APP_LAUNCH_ARCH=foo \
		-DENABLE_MIRCLIENT=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b00ae1009f9b10126d9d9abc4961d9315e6d1fa086e9c010cf752826a166cb2aa9a3f3aa915900ee1156081e409f3df93be970c23c9e5a31f8ab2fa2b9bbf6c9  lomiri-app-launch-0.1.9.tar.gz
28da576336d151e3d79137164b80201499f2a020fe7a17925ed604d4aaa0e3e89aa0e1f512aee61ae002fbf48c1a80de65d8acf5f78ba86a506696d4fb2d5718  0001-liblomiri-app-launch-jobs-posix.cpp-pass-more-enviro.patch
"
